package com.dubbo.consumer.controller.user;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSONObject;
import com.dubbo.service.UserService;
import com.dubbo.vo.BaseResp;
import com.dubbo.vo.UserListVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("user")
public class UserController {

    @Reference(check = false)
    private UserService userService;

    @RequestMapping(value = "/findAll")
    public String hello() {
        BaseResp<UserListVo> resp = userService.findAll();
        return JSONObject.toJSONString(resp);
    }

}
